package com.ustc.hewei.consumerweb.controller;


import com.ustc.hewei.commonmodule.dto.Result;
import com.ustc.hewei.commonmodule.service.IVoucherService;
import com.ustc.hewei.nettyrpc2_0.common.annotation.AutowireService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hewei
 * @since 2022-10-05
 */
@RestController
@RequestMapping("/voucher")
public class VoucherController {
    public IVoucherService getVoucherService() {
        return voucherService;
    }

    public void setVoucherService(IVoucherService voucherService) {
        this.voucherService = voucherService;
    }

    @Resource
    private IVoucherService voucherService;

    @GetMapping("/list/{shopId}")
    public Result queryByShopId(@PathVariable(value = "shopId") Long shopId) {
        return voucherService.queryVoucherByShopId(shopId);
    }
}

